﻿<Window x:Class="iStudio.View.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:ad="clr-namespace:AvalonDock;assembly=AvalonDock"
        xmlns:iStudio="http://schemas.arvystate.net/2012/presentation/iStudio"
        xmlns:general="clr-namespace:iStudio.Control.General"
        xmlns:audio="clr-namespace:iStudio.Control.Audio"
        Title="iStudio" Width="1280" Height="720" WindowStyle="None" AllowsTransparency="True" Background="Transparent" ResizeMode="CanResizeWithGrip" MinHeight="600" MinWidth="800" Closing="WindowClosing" Icon="/iStudio;component/Resources/Icons/iStudio_256x256.png">
    <Grid>
        <Border CornerRadius="5" BorderBrush="#FF505050" BorderThickness="0" Margin="0">
            <Border.Background>
                <ImageBrush ImageSource="/iStudio;component/Resources/bg.jpg" Stretch="UniformToFill" TileMode="None" />
            </Border.Background>
            
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="75" />
                    <RowDefinition />
                </Grid.RowDefinitions>

                <Border BorderBrush="#FF515151" CornerRadius="5,5,0,0" BorderThickness="0,0,0,1" MouseDown="BorderMouseDown" Grid.ColumnSpan="2">
                    <Border.Background>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#FF1b1b1b" Offset="1" />
                            <GradientStop Color="#FF464646" Offset="0" />
                        </LinearGradientBrush>
                    </Border.Background>
                </Border>
                
                <Menu Name="menu_main" Background="Transparent" Height="30" VerticalAlignment="Top" HorizontalAlignment="Left" IsMainMenu="True">
                    <MenuItem Header="File">
                        <MenuItem Header="New" Name="menu_new" Click="MenuOpenClick" />
                        <MenuItem Header="Open ..." Name="menu_open" Click="MenuOpenClick" />
                        <MenuItem Header="Save ..." Name="menu_save" Click="MenuSaveClick" />
                        <MenuItem Header="Save As ..." Name="menu_save_as" Click="MenuSaveClick" />
                        <Separator />
                        <MenuItem Header="Import">
                            <MenuItem Header="File" Name="menu_import_file" Click="MenuImportFileClick" />
                        </MenuItem>
                        <MenuItem Header="Export">
                            <MenuItem Header="Project" Name="menu_export_project" Click="MenuExportProjectClick" />
                        </MenuItem>
                        <Separator />
                        <MenuItem Header="Exit" Name="menu_exit" Click="MenuExitClick" />
                    </MenuItem>
                    <MenuItem Header="Edit">
                        <Separator />
                        <MenuItem Header="Preferences ..." Name="menu_preferences" Click="MenuPreferencesClick" />
                    </MenuItem>
                    <MenuItem Header="Project">
                        <MenuItem Header="Settings" />
                    </MenuItem>
                    <MenuItem Header="Window">
                        <!--<MenuItem Name="menu_analyzer" Header="Analyzer" Click="MenuAnalyzerClick" />
                        <MenuItem Name="menu_equalizer" Header="Equalizer" Click="MenuEqualizerClick" />-->
                        <Separator />
                        <!--<MenuItem Name="menu_filters" Header="Filters" Click="MenuFiltersClick" />
                        <MenuItem Name="menu_effects" Header="Effects" Click="MenuEffectsClick" />
                        <MenuItem Name="menu_functions" Header="Functions" Click="MenuFunctionsClick" />-->
                        <Separator />
                        <MenuItem Name="menu_console" Header="Console" Click="MenuConsoleClick" />
                    </MenuItem>
                    <MenuItem Header="Help">
                        <MenuItem Header="About iStudio" Name="menu_about" Click="MenuAboutClick" />
                    </MenuItem>
                </Menu>

                <general:WindowHeaderControl Margin="0,5,5,0" HorizontalAlignment="Right" VerticalAlignment="Top" />

                <TextBlock Text="iStudio" Foreground="#FFABABAB" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,2,0,0" FontSize="13" FontWeight="SemiBold" Height="20" IsHitTestVisible="False" />

                <audio:PlaybackControl HorizontalAlignment="Stretch" Margin="0,10,0,0" />
                
                <ad:DockingManager x:Name="dockManager" Grid.Row="1" Background="Transparent" Margin="2,0,2,7" Loaded="DockManagerLoaded" Grid.ColumnSpan="2">
                    <ad:ResizingPanel Orientation="Vertical">
                        <ad:ResizingPanel Orientation="Horizontal">
                            <ad:ResizingPanel Orientation="Vertical" ad:ResizingPanel.ResizeWidth="200">
                                <ad:DockablePane>
                                    <ad:DockableContent Title="Files" IsCloseable="False" x:Name="content_file">
                                    
                                    </ad:DockableContent>
                                    <ad:DockableContent Name="dock_functions" Title="Functions">
                                        <TreeView Name="tree_functions" ItemsSource="{Binding}">
                                        </TreeView>
                                    </ad:DockableContent>
                                    <ad:DockableContent Name="dock_effects" Title="Effects">
                                        <TreeView Name="tree_effects" ItemsSource="{Binding}">
                                        </TreeView>
                                    </ad:DockableContent>
                                </ad:DockablePane>
                                <ad:DockablePane>
                                    <ad:DockableContent Title="Spectrum">
                                        <iStudio:Spectrum Name="mainAnalyzer" Margin="5" BarCount="16" />
                                    </ad:DockableContent>
                                </ad:DockablePane>
                            </ad:ResizingPanel>
                            <ad:DocumentPane Name="pane_main">
                                <ad:DockableContent Title="Untitled" IsCloseable="False">
                                    <iStudio:EditorCore x:Name="trackEditor" Margin="5" BorderThickness="1" />
                                </ad:DockableContent>
                            </ad:DocumentPane>
                            <ad:ResizingPanel ad:ResizingPanel.ResizeWidth="250" Orientation="Horizontal">
                                <ad:DockablePane Name="pane_module">
                                </ad:DockablePane>
                            </ad:ResizingPanel>
                        </ad:ResizingPanel>

                        <ad:ResizingPanel Orientation="Vertical" ad:ResizingPanel.ResizeHeight="200">
                            <ad:DockablePane>
                                <ad:DockableContent Name="dock_playback" Title="Playback" IsCloseable="False">
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="50" />
                                        </Grid.RowDefinitions>
                                        
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition />
                                            <ColumnDefinition />
                                            <ColumnDefinition />
                                        </Grid.ColumnDefinitions>

                                        <audio:ProjectControl Margin="5" Grid.RowSpan="2" />
                                        <iStudio:DigitalClock Name="mainClock" Margin="5" Grid.Column="1" ShowSubSeconds="True" />

                                        <audio:SelectionControl Margin="5" Grid.Column="2" />
                                    </Grid>
                                </ad:DockableContent>
                            </ad:DockablePane>
                        </ad:ResizingPanel>

                        <ad:DockablePane Name="pane_bottom" ad:ResizingPanel.ResizeHeight="150">
                            <ad:DockableContent Name="dock_console" Title="Console">
                                <TextBox IsReadOnly="True" AcceptsReturn="True" Name="console" VerticalScrollBarVisibility="Auto" />
                            </ad:DockableContent>
                        </ad:DockablePane>
                    </ad:ResizingPanel>
                </ad:DockingManager>

                <Border x:Name="overlayGrid" CornerRadius="5" Grid.RowSpan="2" Background="Black" Opacity="0.75" Visibility="Hidden" />
            </Grid>
        </Border>
    </Grid>
</Window>
